package com.weighing.system.mapper.server;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.weighing.system.domain.server.ProduceOrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 工单明细 Mapper
 */
@Mapper
public interface ProduceOrderDetailMapper extends BaseMapper<ProduceOrderDetail> {

    /**
     * 根据工单号查询明细
     */
    List<ProduceOrderDetail> selectByBillNo(@Param("billNo") String billNo);

    /**
     * 根据子件编号查询明细
     * @param subMaterialId 子件编号
     * @return 工单明细
     */
    List<ProduceOrderDetail> selectBySubMaterialId(@Param("subMaterialId") String subMaterialId);

    /**
     * 根据工单号和物料编码查询
     * @param subMaterialId 子件编号
     * @param billNo 工单编号
     * @return 工单明细
     */
    ProduceOrderDetail selectBySubMaterialIdAndBillNo(@Param("subMaterialId") String subMaterialId, @Param("billNo") String billNo);
}
